package site.jlopen.entity.grap;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

@Data
public class RenderAttrValueInfo {
	/**
	 * INPUT
	 * SELECT
	 * GROUP
	 */
	private String type;

	private int limit;
	
	private String desc;
	
	private List<RenderAttrItem> items;
	
	@Data
	public static class RenderAttrItem {

		private String label;
		
		private String value;
		
		private List<RenderAttrItem> options;

		public RenderAttrItem(String label) {
			super();
			this.label = label;
		}

		public RenderAttrItem(String label, String value) {
			super();
			this.label = label;
			this.value = value;
		}

		public RenderAttrItem addOption(String label, String value) {
			if(null == this.options) {
				this.options = new ArrayList<RenderAttrValueInfo.RenderAttrItem>();
			}
			this.options.add(new RenderAttrItem(label, value));
			return this;
		}
	}
}
